<?php

$userid = get_loggedin_userid();
$offset = get_input('offset');
$limit  = get_input('limit');

$interests = get_popular_interests($userid, $limit, $offset);
$return = array();

foreach($interests as $interest) {
    $return[] = to_interest_array($interest);
}

echo json_encode(export_result(200, $return));

?>
